import request from '@/config/axios'

// 招聘管理 VO
export interface RecruitmentVO {
  id: number // id
  position: string // 职位名称
  department: string // 所属部门
  location: string // 工作地点
  salary: string // 薪资范围
  requirements: string // 职位要求
  responsibilities: string // 工作职责
  deadline: Date // 截止日期
  sort: number // 排序
  status: number // 状态
}

// 招聘管理 API
export const RecruitmentApi = {
  // 查询招聘管理分页
  getRecruitmentPage: async (params: any) => {
    return await request.get({ url: `/weiyi/recruitment/page`, params })
  },

  // 查询招聘管理详情
  getRecruitment: async (id: number) => {
    return await request.get({ url: `/weiyi/recruitment/get?id=` + id })
  },

  // 新增招聘管理
  createRecruitment: async (data: RecruitmentVO) => {
    return await request.post({ url: `/weiyi/recruitment/create`, data })
  },

  // 修改招聘管理
  updateRecruitment: async (data: RecruitmentVO) => {
    return await request.put({ url: `/weiyi/recruitment/update`, data })
  },

  // 删除招聘管理
  deleteRecruitment: async (id: number) => {
    return await request.delete({ url: `/weiyi/recruitment/delete?id=` + id })
  },

  // 导出招聘管理 Excel
  exportRecruitment: async (params) => {
    return await request.download({ url: `/weiyi/recruitment/export-excel`, params })
  }
}